﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
                    xmlns:c="clr-namespace:ControlLibrary">
    <Style TargetType="c:CoverFlowItemControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:CoverFlowItemControl">
                    <Grid x:Name="LayoutRoot">
                        <Grid.Resources>
                            <Storyboard x:Name="Animation">
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Rotator" Storyboard.TargetProperty="RotationY">
                                    <EasingDoubleKeyFrame x:Name="rotationKeyFrame" KeyTime="00:00:00.9" Value="0">
                                        <EasingDoubleKeyFrame.EasingFunction>
                                            <CubicEase />
                                        </EasingDoubleKeyFrame.EasingFunction>
                                    </EasingDoubleKeyFrame>
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Rotator" Storyboard.TargetProperty="LocalOffsetZ">
                                    <EasingDoubleKeyFrame x:Name="offestZKeyFrame" KeyTime="00:00:00.9" Value="0">
                                        <EasingDoubleKeyFrame.EasingFunction>
                                            <CubicEase />
                                        </EasingDoubleKeyFrame.EasingFunction>
                                    </EasingDoubleKeyFrame>
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="scaleTransform" Storyboard.TargetProperty="ScaleX">
                                    <EasingDoubleKeyFrame x:Name="scaleXKeyFrame" KeyTime="00:00:00.9" Value="1">
                                        <EasingDoubleKeyFrame.EasingFunction>
                                            <CubicEase />
                                        </EasingDoubleKeyFrame.EasingFunction>
                                    </EasingDoubleKeyFrame>
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="scaleTransform" Storyboard.TargetProperty="ScaleY">
                                    <EasingDoubleKeyFrame x:Name="scaleYKeyFrame" KeyTime="00:00:00.9" Value="1">
                                        <EasingDoubleKeyFrame.EasingFunction>
                                            <CubicEase />
                                        </EasingDoubleKeyFrame.EasingFunction>
                                    </EasingDoubleKeyFrame>
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </Grid.Resources>
                        <Grid RenderTransformOrigin=".5,.5">
                            <Grid.RenderTransform>
                                <ScaleTransform x:Name="scaleTransform" ScaleX="1" ScaleY="1" />
                            </Grid.RenderTransform>
                            <Grid.Projection>
                                <PlaneProjection x:Name="Rotator" CenterOfRotationX="0.5" />
                            </Grid.Projection>
                            <ContentControl x:Name="ContentPresenter" RenderTransformOrigin="0.5,0.5" Cursor="Hand" >
                                <ContentPresenter/>
                            </ContentControl>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:CoverFlowControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>  
                    <Grid x:Name="LayoutRoot">
                        <Grid.OpacityMask>
                            <LinearGradientBrush EndPoint="0,.5" StartPoint="1,.5">
                                <GradientStop Color="#00000000" Offset="1"/>
                                <GradientStop Color="#FF000000" Offset="0.8"/>
                                <GradientStop Color="#FE000000" Offset="0.2"/>
                                <GradientStop Color="#00000000" Offset="0"/>
                            </LinearGradientBrush>
                        </Grid.OpacityMask>
                        <ItemsPresenter x:Name="ItemsPresenter" Height="{TemplateBinding Height}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <Canvas x:Name="itemCanvas" />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>